package daobeauty.util;

import java.util.Iterator;

/**
 * A simple interface for Stack operations.
 * 
 * @author M. Serhat Cinar
 *
 * @param <O>
 */
public interface Stack<O> {
	/**
	 * Add element to top of stack 
	 * 
	 * @param element
	 * @throws NoSuchElementException
	 */
	public void push(O element);
	
	/**
	 * Remove and return element from top of stack.
	 * 
	 * @return
	 * @throws NoSuchElementException
	 */
	public O pop();
	
	/**
	 * Have a look at the element on top of stack without removing.
	 * 
	 * @return
	 * @throws NoSuchElementException
	 */
	public O peek();
	
	/**
	 * True, if stack is empty
	 * 
	 * @return
	 */
	public boolean isEmpty();
	
	/**
	 * Adds a element to the bottom of the stack.
	 * 
	 * @param element
	 */
	public void addFirst(O element);
	
	/**
	 * Amount of elements in the stack.
	 * 
	 * @return
	 */
	public int size();
	
	/**
	 * Iterator for the elements of the stack.
	 * 
	 * @return
	 */
	public Iterator<O> iterator();
}